package com.ruoyi.web.service.impl;

import com.ruoyi.web.dto.FaultManagementHandleDto;
import com.ruoyi.web.entity.FaultManagementHandle;
import com.ruoyi.web.mapper.FaultManagementHandleMapper;
import com.ruoyi.web.service.IFaultManagementHandleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-02-01
 */
@Service
public class FaultManagementHandleServiceImpl extends ServiceImpl<FaultManagementHandleMapper, FaultManagementHandle> implements IFaultManagementHandleService {

    private final FaultManagementHandleMapper faultManagementHandleMapper;
    public FaultManagementHandleServiceImpl(FaultManagementHandleMapper faultManagementHandleMapper){
        this.faultManagementHandleMapper = faultManagementHandleMapper;
    }
    /**
     * 查询故障处理
     *
     * @param id 故障处理主键
     * @return 故障处理
     */
    @Override
    public FaultManagementHandleDto selectFaultManagementHandleById(Long id)
    {
        return faultManagementHandleMapper.selectFaultManagementHandleById(id);
    }

    /**
     * 查询故障处理列表
     *
     * @param faultManagementHandle 故障处理
     * @return 故障处理
     */
    @Override
    public List<FaultManagementHandleDto> selectFaultManagementHandleList(FaultManagementHandle faultManagementHandle)
    {
        return faultManagementHandleMapper.selectFaultManagementHandleList(faultManagementHandle);
    }

    /**
     * 新增故障处理
     *
     * @param faultManagementHandle 故障处理
     * @return 结果
     */
    @Override
    public int insertFaultManagementHandle(FaultManagementHandle faultManagementHandle)
    {
        return faultManagementHandleMapper.insertFaultManagementHandle(faultManagementHandle);
    }

    /**
     * 修改故障处理
     *
     * @param faultManagementHandle 故障处理
     * @return 结果
     */
    @Override
    public int updateFaultManagementHandle(FaultManagementHandle faultManagementHandle)
    {
        return faultManagementHandleMapper.updateFaultManagementHandle(faultManagementHandle);
    }

    /**
     * 批量删除故障处理
     *
     * @param ids 需要删除的故障处理主键
     * @return 结果
     */
    @Override
    public int deleteFaultManagementHandleByIds(Long[] ids)
    {
        return faultManagementHandleMapper.deleteFaultManagementHandleByIds(ids);
    }

    /**
     * 删除故障处理信息
     *
     * @param id 故障处理主键
     * @return 结果
     */
    @Override
    public int deleteFaultManagementHandleById(Long id)
    {
        return faultManagementHandleMapper.deleteFaultManagementHandleById(id);
    }
}
